package com.iplant.aps.service.apsenum.aps;

/**
 * 排程版本的状态枚举
 *
 * @author YouWang·Peng
 * 2023-8-16 09:24:37
 */
public enum APSSchedulingVersionBPMStatus {
    /**
     * 默认
     */
    Default(0, "默认"),
    /**
     * 保存
     */
    Saved(1, "保存"),
    /**
     * 已审批
     */
    Confirm(20, "已审批"),
    /**
     * 已撤销
     */
    Rejected(21, "已撤销"),
    /**
     * 已驳回
     */
    Canceled(22, "已驳回");


    private int value;
    private String label;

    APSSchedulingVersionBPMStatus(int value, String label) {
        this.value = value;
        this.label = label;
    }

    /**
     * 通过 value 的数值获取枚举实例
     */
    public static APSSchedulingVersionBPMStatus getEnumType(int val) {
        for (APSSchedulingVersionBPMStatus type : APSSchedulingVersionBPMStatus.values()) {
            if (type.getValue() == val) {
                return type;
            }
        }
        return Default;
    }

    public int getValue() {
        return value;
    }

    public String getLabel() {
        return label;
    }
}
